/*
 * Copyright 2021-2022 the original author(https://github.com/wj596)
 * 
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * </p>
 */
package org.jsets.fastboot.operlog.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.jsets.fastboot.operlog.model.OperType;

/**
 * 操作日志注解
 *
 * @author wangjie (https://github.com/wj596)
 * @date 2021.07.10 23:56
 */
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface OperLog {

	/**
	 * 子系统
	 */
	public String subsystem() default "";

	/**
	 * 模块
	 */
	public String module() default "";
	
	/**
	 * 功能
	 */
	public String func() default "";
	
	/**
	 * 内容
	 */
	public String content() default "";
	
	/**
	 * 操作类型
	 */
	public OperType operType() default OperType.AUTO;

	/**
	 * 是否保存请求参数
	 */
	public boolean saveParameters() default true;

	/**
	 * 是否保存返回值
	 */
	public boolean saveReturnValue() default false;

	/**
	 * 是否保存request信息包含 requestMethod、requestIp
	 */
	public boolean saveRequestInfo() default false;

	/**
	 * 是否使用MDC信息
	 */
	//public String[] mdcKeys() default {};

	/**
	 * 是否异步处理
	 */
	public boolean async() default false;

}